﻿using System.IO;
using System.Text;

namespace Utils.Extensions
{
    public static class StreamExtension
    {
        public static string ReadTextResponse(this Stream stream, string characterSet)
        {
        	Encoding encoding = Encoding.GetEncoding(characterSet);
			using (StreamReader reader = new StreamReader(stream, encoding))
			{
				return reader.ReadToEnd();
			}
        }
    }
}